package com.gzyj.jtt808.v2013.protocol.jtt1078;

import com.gzyj.jtt808.v2013.Package;
import com.gzyj.jtt808.v2013.enums.BusinessDataType;
import io.netty.buffer.ByteBuf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("文件上传完成通知")
public class JTT808_0x1206 extends Package implements Serializable {

    @ApiModelProperty("流水号")
    public Integer MsgNum;

    @ApiModelProperty("结果")
    public Byte Result;

    public JTT808_0x1206(){
        super(BusinessDataType.文件上传完成通知.getCode());
    }

    @Override
    public void encodeImpl(ByteBuf buf) {
        buf.writeShort(this.MsgNum);
        buf.writeByte(this.Result);
    }

    @Override
    public JTT808_0x1206 decodeImpl(ByteBuf buf) {
        this.MsgNum=buf.readUnsignedShort();
        this.Result=buf.readByte();
        return this;
    }
}
